<template>
  <div class="chianMap">
    <div ref="chartsTable" style="width: 600px; height: 400px"></div>
  </div>
</template>
<script>
import "echarts/map/js/china";
export default {
  data() {
    return {
      option: {
        title: {
          text: "中国地图",
        },
        tooltip: {},
        series: [
          {
            type: "map",
            map:"china",
            data: [5, 20, 36, 10, 10, 20],
            zoom:1.2
          },
        ],
      },
    };
  },
  mounted() {
    this.init();
  },
  methods: {
    init() {
      //基于准备好的dom，初始化chart实例（this.$refs.元素ID来获取当前元素)
      var myChart = this.$echarts.init(this.$refs.chartsTable);

      // 使用刚指定的配置项和数据显示图表。
      myChart.setOption(this.option);
    },
  },
};
</script>

<style scoped>
.chianMap{
      margin-left: 243px;
    margin-top: 40px;
}
</style>